<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/cookie.js"></script>
</head>

<body>
    <button class="btn">存储cookie</button>
    <button class="get">修改cookie</button>
</body>
<script>

    var btn = document.querySelector(".btn");
    var getBtn = document.querySelector(".get");

    btn.onclick = function () {
        // 存cookie
        setCookie("user", "a123123", 7);   //实际参数
        setCookie("pwd", "123123", 7);
        setCookie("phone", "17386141517", 7);
        setCookie("email", "123@qq.com", 7);


    }

    getBtn.onclick = function () {

        // cookie 的修改   (对应键名 再次赋值)
        setCookie("user", "b123123");


    }













</script>

</html>